using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using UMLDesigner.Widgets;
using UMLDesigner.Page;

namespace UMLDesigner
{
    public partial class Toolbox : DockContent
    {
        public Toolbox()
        {
            InitializeComponent();
        }

        public UMLPage CurrentPage
        {
            get;
            set;
        }

        private void addClassButton_Click(object sender, EventArgs e)
        {
            if(CurrentPage != null) CurrentPage.Document.AddWidget(Widgets.UMLWidgetType.CLASS);
        }

        private void addNoteButton_Click(object sender, EventArgs e)
        {
            if (CurrentPage != null) CurrentPage.Document.AddWidget(Widgets.UMLWidgetType.NOTE);
        }

        private void addAssociateLink_Click(object sender, EventArgs e)
        {
            if (CurrentPage != null)
            {
                AssociateLinkWidget link = new AssociateLinkWidget();
                CurrentPage.SetTemporaryLinkWidget(link);
            }
        }
    }
}